package com.zxbg.dao;

import com.zxbg.domain.ErrorPage;
import org.apache.ibatis.annotations.*;

import java.util.List;

public interface ErrorPageDao {
    @Select("select * from error_page where tenant_id = #{tenant_id}")
    public List<ErrorPage> getAllErrorPageInfo(Integer tenant_id);

    @Select("select * from error_page where error_type = #{error_type} and tenant_id = #{tenant_id}")
    public List<ErrorPage> getErrorByErrorType(@Param("error_type") String error_type, @Param("tenant_id") Integer tenant_id);

    @Insert("insert into error_page values(#{error_type}, #{tenant_id}, #{main_title}, #{describe}, NOW(), #{updater_id})")
    public int addErrorPage(ErrorPage errorPage);

    @Update("update error_page set main_title = #{main_title}, `describe` = #{describe}, update_time = NOW(), updater_id = #{updater_id} where error_type = #{error_type}")
    public int updateErrorPage(ErrorPage errorPage);

    @Delete("delete from error_page where error_type = #{error_type} and tenant_id = #{tenant_id}")
    public int deleteErrorPage(@Param("error_type") String error_type, @Param("tenant_id") Integer tenant_id);
}
